<?
   function gen_chars_no_dup($long=6)  
   {  
      $chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";  
      mt_srand((double)microtime()*1000000);   
      $i=0;  
      while ($i != $long) {  
          $rand=mt_rand() % strlen($chars);  
          $tmp=$chars[$rand];  
          $pass=$pass . $tmp;  
          $chars=str_replace($tmp, "", $chars);  
          $i++;  
     }  
      return strrev($pass);  
   }  

?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>www.sitgem.com</title>
</head>

<body>
<table border="0" width="100px">
<tr>
<td align="center">

<img src="crea_imagen.php?code=<?=gen_chars_no_dup();?>" border="0" />

<form name="captcha-form" method="POST" action="validar.php">

         <input type="text" name="code" width="55px" /><BR />

         <input type="submit" name="submit" value="COMPRAR" />

</form>
</td></tr></table>
</body>
</html>

